package drone.basis.base ;

import java.util.List ;
import java.util.Map ;

import io.swagger.annotations.ApiModel ;
import io.swagger.annotations.ApiModelProperty ;
import drone.basis.util.PageUtil ;

@ApiModel ( "基础查询数据" )
public class BaseQuery < E > extends BaseBean
{

	private static final long serialVersionUID = 1L ;

	@ApiModelProperty ( value = "信息实体" , dataType = "Map" )
	protected E persistBean ;

	@ApiModelProperty ( value = "持久化实体列表" , dataType = "List" )
	protected List < E > persistList ;

	@ApiModelProperty ( value = "主键" )
	protected String primaryNo ;

	@ApiModelProperty ( value = "查询语句" )
	protected String sqlInfo ;

	@ApiModelProperty ( value = "聚合字段" )
	protected String polyField ;

	@ApiModelProperty ( value = "排序字段" )
	protected String sortField ;

	@ApiModelProperty ( value = "排序顺序" )
	protected Boolean sortOrder ;

	@ApiModelProperty ( value = "参数集合" )
	protected Map < String , Object > queryParam ;

	@ApiModelProperty ( value = "分页对象" , dataType = "PageUtil" )
	protected PageUtil pageUtil ;

	@ApiModelProperty ( value = "版本号" )
	protected String verisonNo ;

	@ApiModelProperty ( value = "路径" )
	protected String pathInfo ;

	@ApiModelProperty ( value = "负责人" )
	protected String authorName ;

	@ApiModelProperty ( value = "业务流水号" )
	protected String serialNo ;

	@ApiModelProperty ( value = "受理方" )
	protected String issueName ;

	@ApiModelProperty ( value = "令牌" )
	protected String tokenInfo ;

	@ApiModelProperty ( value = "数字签名" )
	protected String signatureInfo ;

	public BaseQuery ( )
	{

	}

	public BaseQuery (
			String primaryNo
	)
	{
		this.primaryNo = primaryNo ;
	}

	public BaseQuery (
			Map < String , Object > queryParam
	)
	{
		this.queryParam = queryParam ;
	}

	public BaseQuery (
			E persistBean
	)
	{
		this.persistBean = persistBean ;
	}

	public BaseQuery (
			List < E > persistList
	)
	{
		this.persistList = persistList ;
	}

	public BaseQuery (

			String polyField ,
			Map < String , Object > queryParam
	)
	{
		this.polyField = polyField ;
		this.queryParam = queryParam ;
	}

	public BaseQuery (
			String sqlInfo ,
			PageUtil pageUtil
	)
	{
		this.sqlInfo = sqlInfo ;
		this.pageUtil = pageUtil ;
	}

	public BaseQuery (
			String sortField ,
			Boolean sortOrder ,
			PageUtil pageUtil ,
			Map < String , Object > queryParam
	)
	{
		this.sortField = sortField ;
		this.sortOrder = sortOrder ;
		this.pageUtil = pageUtil ;
		this.queryParam = queryParam ;
	}

	public BaseQuery (
			Builder < E > builder
	)
	{

		this.persistBean = builder.persistBean ;
		this.persistList = builder.persistList ;
		this.primaryNo = builder.primaryNo ;
		this.sqlInfo = builder.sqlInfo ;
		this.polyField = builder.polyField ;
		this.sortField = builder.sortField ;
		this.sortOrder = builder.sortOrder ;
		this.queryParam = builder.queryParam ;
		this.pageUtil = builder.pageUtil ;
		this.verisonNo = builder.verisonNo ;
		this.pathInfo = builder.pathInfo ;
		this.authorName = builder.authorName ;
		this.serialNo = builder.serialNo ;
		this.issueName = builder.issueName ;
		this.tokenInfo = builder.tokenInfo ;
		this.signatureInfo = builder.signatureInfo ;

	}

	public E getPersistBean ( )
	{
		return persistBean ;
	}

	public void setPersistBean (
			E persistBean
	)
	{
		this.persistBean = persistBean ;
	}

	public List < E > getPersistList ( )
	{
		return persistList ;
	}

	public void setPersistList (
			List < E > persistList
	)
	{
		this.persistList = persistList ;
	}

	public String getPrimaryNo ( )
	{
		return primaryNo ;
	}

	public void setPrimaryNo (
			String primaryNo
	)
	{
		this.primaryNo = primaryNo ;
	}

	public String getPolyField ( )
	{
		return polyField ;
	}

	public void setPolyField (
			String polyField
	)
	{
		this.polyField = polyField ;
	}

	public String getSortField ( )
	{
		return sortField ;
	}

	public void setSortField (
			String sortField
	)
	{
		this.sortField = sortField ;
	}

	public Boolean getSortOrder ( )
	{
		return sortOrder ;
	}

	public void setSortOrder (
			Boolean sortOrder
	)
	{
		this.sortOrder = sortOrder ;
	}

	public Map < String , Object > getQueryParam ( )
	{
		return queryParam ;
	}

	public void setQueryParam (
			Map < String , Object > queryParam
	)
	{
		this.queryParam = queryParam ;
	}

	public PageUtil getPageUtil ( )
	{
		return pageUtil ;
	}

	public void setPageUtil (
			PageUtil pageUtil
	)
	{
		this.pageUtil = pageUtil ;
	}

	public String getVerisonNo ( )
	{
		return verisonNo ;
	}

	public void setVerisonNo (
			String verisonNo
	)
	{
		this.verisonNo = verisonNo ;
	}

	public String getPathInfo ( )
	{
		return pathInfo ;
	}

	public void setPathInfo (
			String pathInfo
	)
	{
		this.pathInfo = pathInfo ;
	}

	public String getAuthorName ( )
	{
		return authorName ;
	}

	public void setAuthorName (
			String authorName
	)
	{
		this.authorName = authorName ;
	}

	public String getSerialNo ( )
	{
		return serialNo ;
	}

	public void setSerialNo (
			String serialNo
	)
	{
		this.serialNo = serialNo ;
	}

	public String getIssueName ( )
	{
		return issueName ;
	}

	public void setIssueName (
			String issueName
	)
	{
		this.issueName = issueName ;
	}

	public String getTokenInfo ( )
	{
		return tokenInfo ;
	}

	public void setTokenInfo (
			String tokenInfo
	)
	{
		this.tokenInfo = tokenInfo ;
	}

	public String getSignatureInfo ( )
	{
		return signatureInfo ;
	}

	public void setSignatureInfo (
			String signatureInfo
	)
	{
		this.signatureInfo = signatureInfo ;
	}

	public String getSqlInfo ( )
	{
		return sqlInfo ;
	}

	public void setSqlInfo (
			String sqlInfo
	)
	{
		this.sqlInfo = sqlInfo ;
	}

	public static class Builder < E >
	{

		private E persistBean ;

		private List < E > persistList ;

		private String primaryNo ;

		private String sqlInfo ;

		private String polyField ;

		private String sortField ;

		private Boolean sortOrder ;

		private Map < String , Object > queryParam ;

		private PageUtil pageUtil ;

		private String verisonNo ;

		private String pathInfo ;

		private String authorName ;

		private String serialNo ;

		private String issueName ;

		private String tokenInfo ;

		private String signatureInfo ;

		public Builder < E > persistBean (
				E persistBean
		)
		{
			this.persistBean = persistBean ;
			return this ;
		}

		public Builder < E > persistList (
				List < E > persistList
		)
		{
			this.persistList = persistList ;
			return this ;
		}

		public Builder < E > primaryNo (
				String primaryNo
		)
		{
			this.primaryNo = primaryNo ;
			return this ;
		}

		public Builder < E > sqlInfo (
				String sqlInfo
		)
		{
			this.sqlInfo = sqlInfo ;
			return this ;
		}

		public Builder < E > polyField (
				String polyField
		)
		{
			this.polyField = polyField ;
			return this ;
		}

		public Builder < E > sortField (
				String sortField
		)
		{
			this.sortField = sortField ;
			return this ;
		}

		public Builder < E > sortOrder (
				Boolean sortOrder
		)
		{
			this.sortOrder = sortOrder ;
			return this ;
		}

		public Builder < E > queryParam (
				Map < String , Object > queryParam
		)
		{
			this.queryParam = queryParam ;
			return this ;
		}

		public Builder < E > pageUtil (
				PageUtil pageUtil
		)
		{
			this.pageUtil = pageUtil ;
			return this ;
		}

		public Builder < E > verisonNo (
				String verisonNo
		)
		{
			this.verisonNo = verisonNo ;
			return this ;
		}

		public Builder < E > pathInfo (
				String pathInfo
		)
		{
			this.pathInfo = pathInfo ;
			return this ;
		}

		public Builder < E > authorName (
				String authorName
		)
		{
			this.authorName = authorName ;
			return this ;
		}

		public Builder < E > serialNo (
				String serialNo
		)
		{
			this.serialNo = serialNo ;
			return this ;
		}

		public Builder < E > issueName (
				String issueName
		)
		{
			this.issueName = issueName ;
			return this ;
		}

		public Builder < E > tokenInfo (
				String tokenInfo
		)
		{
			this.tokenInfo = tokenInfo ;
			return this ;
		}

		public Builder < E > signatureInfo (
				String signatureInfo
		)
		{
			this.signatureInfo = signatureInfo ;
			return this ;
		}

		public BaseQuery < E > build ( )
		{
			return new BaseQuery < E > ( this ) ;
		}
	}

}
